<script>
function search_goods (fitem)
{
    var val = $(fitem).val();
    var form = fitem.form;
    var btn  = $(form).find('input[type=submit]');

    $.get('/admin/package/json/packageInfo/' + val, function (o) {
        if (o.status != 0)
        {
            var errmsg = '<h3>包名: ' + val + ' 对应的包不存在!</h3>';
            $('.packageInfo').html(errmsg);
            btn.attr('disabled', 'disabled');
        }
        else
        {
            var pkg = o.package;
            var ul  = '<ul>';
            ul += '<li>名称：' + pkg.name + '</li>';
            ul += '<li>下载：' + pkg.downloadCount + '</li>';
            ul += '<li>版本：' + pkg.versionName + '</li>';
            ul += '<li>分类：' + pkg.categoryName + '</li>';
            ul += '<li><img src="' + pkg.iconUrl + '"></li>';
            ul += '</ul>';

            $('.packageInfo').html(ul);
            btn.removeAttr('disabled');

            $(form).find('input[name=downloadCount]').val(pkg.downloadCount);
        }
    }, 'json');
}
</script>

<div class="packageInfo">
</div>
